{extend name='main'}

{block name="content"}
<button data-modal='{:url("add_level")}' data-title="添加等级" class='layui-btn'>添加等级</button>
<div class="think-box-shadow">

<!--    <table class="layui-table margin-top-15" lay-filter="tab" lay-skin="line">-->
    <table class="layui-table margin-top-15" >
        <thead>
        <tr>
            <th lay-data="{field:'id',width:80}" class='text-left nowrap'>ID</th>
            <th lay-data="{field:'name',width:80}" class='text-left nowrap'>名称</th>
            <th lay-data="{field:'money',width:80}" class='text-left nowrap'>最低抢单金额</th>
            <th lay-data="{field:'order_num',width:80}" class='text-left nowrap'>任务次数</th>
            <!--<th lay-data="{field:'w_num',width:80}" class='text-left nowrap'>提现次数</th>-->
            <th lay-data="{field:'w_min',width:80}" class='text-left nowrap'>提现金额最小限制</th>
            <th lay-data="{field:'w_max',width:80}" class='text-left nowrap'>提现金额最大限制</th>
            <!--<th lay-data="{field:'level_day',width:80}" class='text-left nowrap'>VIP有效期/天</th>-->
            <!--<th lay-data="{field:'w_order_num',width:80}" class='text-left nowrap'>提现至少完成订单/天</th>-->
            <th lay-data="{field:'yjbl',width:80}" class='text-left nowrap'>佣金比例</th>
            <th lay-data="{field:'txsxf',width:80}" class='text-left nowrap'>提现手续费</th>
            <th lay-data="{field:'create_time',width:200}" class='text-left nowrap'>创建时间</th>
            <th lay-data="{field:'edit',width:280,fixed: 'right'}" class='text-left nowrap'>操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr>
            <td class='text-left nowrap'>{$vo.id}</td>
            <td class='text-left nowrap'>{$vo.name}</td>
            <td class='text-left nowrap'>{$vo.money}</td>
            <td class='text-left nowrap'>{$vo.order_num}</td>
            <!--<td class='text-left nowrap'>{$vo.w_num}</td>-->
            <td class='text-left nowrap'>{$vo.w_min}</td>
            <td class='text-left nowrap'>{$vo.w_max}</td>
            <!--<td class='text-left nowrap'>{$vo.level_day}</td>-->
            <!--<td class='text-left nowrap'>{$vo.w_order_num}</td>-->
            <td class='text-left nowrap'>{$vo.yjbl}</td>
            <td class='text-left nowrap'>{$vo.txsxf}</td>
            <td class='text-left nowrap'>{$vo.create_time|format_datetime}</td>
            <td class='text-left nowrap'>
                <a data-dbclick class="layui-btn layui-btn-xs" data-title="编辑" data-modal="{:Url('users/edit_level',['id'=>$vo.id])}">编辑</a>
                <a class="layui-btn layui-btn-xs layui-btn" onClick="del_level({$vo.id})" style='background:red;'>删除</a>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>

    <script>
        function del_level(id){
            layer.confirm("确认要删除吗，删除后不能恢复",{ title: "删除确认" },function(index){
                $.ajax({
                    type: 'POST',
                    url: "{:url('del_level')}",
                    data: {
                        'id': id,
                    },
                    success:function (e) {
                        layer.msg(e.msg,{time:2500});
                        location.reload();
                    }
                });
            },function(){});
        }
    </script>
    <script>
        var table = layui.table;
        //转换静态表格
        var limit = Number('{$Think.get.limit}');
        if(limit==0) limit=20;
        table.init('tab', {
            cellMinWidth:120,
            skin: 'line,row',
            size: 'lg',
            limit: limit
        });
    </script>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
{/block}
